/**
 * 门面模式/外观模式
 */

class Shape {}

class Square extends Shape {
  constructor(...args) {
    super()
  }

  draw() {
    console.log('这是一个正方形')  
  }

}

class Rectangle extends Shape {
  constructor(...args) {
    super()
  }

  draw() {
    console.log('这是一个长方形')  
  }

}

class Circle extends Shape {
  constructor(...args) {
    super()
  }

  draw() {
    console.log('这是一个圆形')  
  }

}

class ShapeMaker {
  constructor() {
    this.circle = new Circle()
    this.rectangle = new Rectangle()
    this.square = new Square()  
  }

  drawCircle() {
    this.circle.draw()  
  }

  drawRectangle() {
    this.rectangle.draw()  
  }
  
  drawSquare() {
    this.square.draw()  
  }

}

const shapeMaker = new ShapeMaker()

shapeMaker.drawCircle()
shapeMaker.drawRectangle()
shapeMaker.drawSquare()
